﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace CPA
{
        enum GameState
        {
            Loading01,StartMenu,FmvIntro,Level01,GameOver,Level02,FmvIntroVillage,Fmv04,Fmv05,Fmv06
        }
   /// <summary>
    /// This is the main type for your game
    /// </summary>
    public partial class Game1 : Microsoft.Xna.Framework.Game
    {
        static Vector2 gravity = new Vector2(0, 500);

        GameState gameState = new GameState();

       
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            // TODO: Add your update logic here

            switch (gameState)
            {
                case GameState.Loading01:
                    gameState = GameState.StartMenu;
                    break;
                    
                case GameState.StartMenu:
                    menu.update();
                    gameState = menu.get_state();
                    break;

                case GameState.FmvIntro:
                    FmvIntro.update();
                    gameState = FmvIntro.get_state();
                    //gameState = GameState.Level01;
                    break;

                case GameState.Level01:
                    level01.update();
                    gameState = level01.get_state();
                    break;

                case GameState.Fmv04:
                    fmv04.update();
                    gameState = fmv04.get_state();
                    break;

            }


            base.Update(gameTime);
        }
    }
}
